package com.xgz.entity;

public class Animal {

    public String color;//共有的属性
    protected Integer height;
    private String name;
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    //共有的构造方法
    public Animal(){

    }

    public Animal(String color, Integer height, String name, Integer age) {
        this.color = color;
        this.height = height;
        this.name = name;
        this.age = age;
    }

    //私有的构造方法
    private Animal(String color){
        this.color = color;
    }

    private Animal(Integer height, String name, Integer age) {
        this.height = height;
        this.name = name;
        this.age = age;
    }
}
